<div class="uk-layui-form">
	<form class="layui-form" action="/apps/workorder/type/save.html" method="post">
		<input type="hidden" name="id" value="${workOrderType.id!''}">
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label" style="width:260px;">分类名称：</label>
				<div class="layui-input-inline">
					<input type="text" name="name" value="${workOrderType.name!''}" required lay-verify="required" autocomplete="off"
						class="layui-input">
				</div>
				<div class="layui-form-mid layui-word-aux">
	            	<font color="red">*</font> 
	            	工单分类名称
	            </div>
			</div>
		</div>
		<#if models?? && models["workflow"]?? && models["workflow"] == true>
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label" style="width:260px;">启用流程：</label>
				<div class="layui-input-inline">
					<input type="checkbox" name="bpm" lay-filter="bpm" lay-skin="switch" <#if workOrderType.bpm>checked</#if> lay-text="开启|关闭">
				</div>
			</div>
		</div>
		
		<div class="layui-form-item" id="process" style="<#if workOrderType.bpm == false>display:none;</#if>">
			<div class="layui-inline">
				<label class="layui-form-label" style="width:260px;">工单流程：</label>
				<div class="layui-input-inline">
					<select name="processid" lay-verify="">
						<#if processContentList??>
						<#list processContentList as process>
							<option value="${process.id!''}">${process.title!''}</option>
						</#list>
						</#if>
					</select>   
				</div>
			</div>
		</div>
		</#if>
		<div class="layui-form-button">
			<div class="layui-button-block">
				<button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
				<button type="reset" class="layui-btn layui-btn-primary">重置</button>
			</div>
		</div>
	</form>
</div>
<script>
	layui.use('form', function() {
		var form = layui.form;
		form.render(); //更新全部
		form.on('switch(bpm)', function(data){
			if(data.elem.checked){
				$('#process').show();
			}else{
				$('#process').hide();
			}
		});
	});
</script>